<?php
class Administrator_PaystatuController extends Zend_Controller_Action
{
	public function init()
	{
		$member=new CMember();
		if(!$member->isUser($this->_request->getModuleName(),$this->_request->getControllerName())){	
			$this->_redirect(MY_URL.'/administrator-auth-login');
		}
	}
	
	public function preDispatch()
	{
		$this->getHelper ('layout')->setLayout('framelayout');
		$this->view->addHelperPath(MY_ROOT.'/vhelpers');
		Zend_Controller_Action_HelperBroker::addPath(MY_ROOT.'/chelpers');
	}
	
	public function indexAction()
	{
		$paystatu = new CPaystatu();
    	$statu = $this->getRequest()->getParam('statu');
    	$page = $this->getRequest()->getParam('page');
    	
    	$page = intval($page);
    	$pageNum = 5;
    	
    	$list = $paystatu->getList($statu, $page, $pageNum);
    	$pageCount = $paystatu->getPageCount($statu, $pageNum);
    	$pageString = CPage::divPages($pageCount, $page, ROOT_PATH."/administrator-paystatu?statu=" . $statu . '&');
    	
    	$this->view->list = $list;
    	$this->view->pageString = $pageString;
    	$this->view->pageCount = $pageCount;
    	$this->view->statu = $statu;
	}
}